﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    public class AIY
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [Required]
        public Guid id { get; set; }
        //默认值
        //public Guid id { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 姓
        /// </summary>
        [Required]
        [StringLength(50)]
        public string? FirstName { get; set; }
        /// <summary>
        /// 名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string? LastName { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
       public string? Name { get => this.FirstName + this.LastName; }

        //NotMapped:不映射到数据库
        //[NotMapped]
        //private string? name;
        //[NotMapped]
        //public string? Name
        //{
        //    get { return this.FirstName + this.LastName; }
        //}



        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public  DateTime DateTime { get; set; }
    }
}
